
import request from "../utils/request";
export  default { 
    getAllPosition(pageNum,pageSize){
        const params = {
            pageNum,
            pageSize
        }
        return request.get("/position",{params},{
            method:"get"
        })
    },
    addPosition(addPosition){
        return request.post("/position",addPosition,{
            method:"post"
        })
    },
    getPositionCount(deptId,positionName,status){
        const params = {
            deptId,
            positionName,
            status
        }
        return request.get("/position/getPositionCount",{params},{
            method:"get"
        })
    },
    getSpeciePosition(deptName,positionName,status,pageNum,pageSize){
        const params = {
            deptName,
            positionName,
            status,
            pageNum,
            pageSize
        }
        return request.get("/position/getSpeciePosition",{params},{
            method:"get"
        })
    },
    deletePositionById(id){
        let params;
        if(typeof id === "string"){
            params = {
                id:[id]
            }
        }else{  
            params = {
                id: id
            }
        }
        return request.patch("/position",params,{
            headers: {
                'Content-Type': 'application/json'
            },
            method:"patch"
        })
    },
    getEditPositionDetail(id){
        const params = {
            id
        }
        return request.get("/position/getEditPositionDetail",{params},{
            method:"get"
        })
    },
    updatePosition(updatePosition){ 
        return request.put("/position",updatePosition,{
            method:"put"
        })
    },
    getPositionSelect(id){
        const params = {
            id
        }
        return request.get("/position/getPositionByDepartmentId",{params},{
            method:"get"
        })
    },
}
